function foo(item) {
    return new Promise((resolve, reject) => {
        setTimeout(() => {
            resolve(item)
        }, 1000)
    })
}

// [1, 2, 3].forEach(async item => {
//     const result = await foo(item); // 1=> 2=> 3
//     console.log(result);
// })

[1, 2, 3].map(async item => {
    const result = await foo(item); // 1=> 2=> 3
    console.log(result);
})

(async () => {
    for (let i = 0; i < 3; i++) {
        const result = await foo(i);
        console.log(result);
    }
})()